package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.UserDto;
import com.zzyl.entity.User;
import com.zzyl.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {


    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);


    User selectByPrimaryKey(Long id);



    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    /**
     * 这是Mybatis Generator拓展插件生成的方法(请勿删除).
     * This method corresponds to the database table sys_user
     *
     * @mbg.generated
     * @author hewei
     */
    int batchInsert(@Param("list") List<User> list);


    /**
     * 修改基础字段
     * @param user
     */
    void modify(User user);

    /**
     * 启用禁用
     * @param id
     * @param status
     */
    void enableOrDisable(@Param("id") Long id,@Param("status") String status);


    /**
     * 用户列表
     * @param user
     * @return
     */
    List<UserVo> userList(User user);

    List<User> findByPage(UserDto userDto);


    /**
     * 登录
     * @param username
     * @return
     */
    @Select("select * from sys_user where username=#{username};")
    User selectByUsername(String username);
}